﻿/*
 * 文件名:Checking.cs
 * 类名:XHCTMS.BLL.Checking
 * 创建人: 仇祖萍
 * 重写: 杨航
 * 创建时间: 2013-5-21 19:34:30
 *  
 * 最近更新：2013-7-4 
 * 备注: 
 * 
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace XHCTMS.BLL
{
    /// <summary>
    /// 对考勤表进行考勤和查询操作
    /// </summary>
    public class Checking
    {
        /// <summary>
        /// 分页获取考勤信息
        /// </summary>
        /// <param name="pageSize">页面大小</param>
        /// <param name="pageIndex">当前页号</param>
        /// <returns>返回DataTable类型  null/异常</returns>
        public DataTable Paging(int pageSize, int pageIndex)
        {
            return new DAL.Checking().Paging(pageSize, pageIndex);
        }

        /// <summary>
        /// 每日考勤
        /// </summary>
        /// <param name="checking">考勤信息</param>
        /// <returns>返回int类型 1/成功, 0/失败, -1/异常</returns>
        public int Add(MODEL.Checking checking)
        {
            return new DAL.Checking().AddChecking(checking);
        }

        /// <summary>
        /// 查询考勤信息
        /// </summary>
        /// <returns>返回DataTable类型 null/异常</returns>
        public DataTable View(int teachingId)
        {
            return new DAL.Checking().View(teachingId);
        }

        /// <summary>
        /// 按条件查询考勤信息，分页显示结果
        /// </summary>
        /// <param name="query"></param>
        /// <returns>返回DataTable类型 null/异常</returns>
        public DataTable Select( int pageIndex,int query)
        {
            return new DAL.Checking().SelectByCondition(pageIndex,query);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public string Amount()
        {
            return new DAL.Checking().GetAmount();
        }

        public DataTable Search(int classId, string time, int pageSize, int pageIndex)
        {
            return new DAL.Checking().Search(classId, time, pageSize, pageIndex);
        }

        public string GetCountPage(int pageSize)
        {
            return new DAL.Checking().GetCountPage(pageSize);
        }

        public DataTable GetCountPage(int classId, string time)
        {
            return new DAL.Checking().GetCountPage(classId, time);
        }
    }
}
